﻿@model IEnumerable<HotelMgr.Models.RoomType>
@using Telerik.Web.Mvc.UI
@using HotelMgr.Models
@{
    ViewBag.Title = "Index";
}

<h2 style="text-align: center;font-size: 20px;font-weight:bolder;">房间类型管理</h2>

@*<p>
    @Html.ActionLink("添加房间类型", "Create")
</p>*@
@(Html.Telerik().Grid(Model)
.Name("RoomTypeGrid")
.DataKeys(key=>key.Add(k=>k.RoomTypeID))
.ToolBar(c=>c.Insert().ButtonType(GridButtonType.Image))
.DataBinding(b=>b.Server()
        .Select("Select", "RoomType")
        .Insert("Insert", "RoomType")
        .Update("Save", "RoomType")
        .Delete("Delete", "RoomType")
)
.Columns(r=>
             {
                 r.Bound(i => i.TypeName);
                 r.Bound(i => i.Price);
                 @*r.Template(@<text>
                                 @Html.ActionLink("修改", "Edit", new {id = item.RoomTypeID},null) |
                                 @Html.ActionLink("详细", "Details", new {id = item.RoomTypeID},null) |
                                 @Html.ActionLink("删除", "Delete", new {id = item.RoomTypeID},null)
                             </text>).Title("操作");*@
                 r.Command(c =>
                               {
                                   c.Edit().ButtonType(GridButtonType.Image);
                                   c.Delete().ButtonType(GridButtonType.Image);
                               });
             })
             .Editable(e=>e.Mode(GridEditMode.InLine))
             .Pageable()
             .Scrollable(i=>i.Enabled(true))
             .Footer(true)
)

